const express = require("express");
let app = express();
// const bodyParser = require("body-parser");

const bodyParser = require("./mybodyparser");
app.use(bodyParser.urlencoded({}));

// 加载 index.html  ，发送post数据
app.get("/", (req, res) => {
  res.sendFile(__dirname + "/views/index.html");
});

app.post("/postdata", (req, res) => {
  console.log("body", req.body); // 接收post数据
});

app.listen(8989);
